<template>
    <view class="order-list">

        <!-- order-item.wxml -->
        <van-cell-group inset>
            <van-cell v-for="(item, index) in orderlist" :key="index" use-label-slot is-link @click="handleDetail(item.id)" clickable
                :data-id="item.id">
                <view slot="title">
                    <text>订单号：{{ item.order_no }}</text>
                </view>
                <view slot="label">
                    <view>
                        <text>订单金额：¥{{ item.order_amount }}</text>
                    </view>

                    <view>
                        <text>订单积分：{{ item.order_score }}</text>
                    </view>
                    <view>
                        <text>订单状态：{{ item.status_text }}</text>
                    </view>
                    <view>
                        <text>创建时间：{{ item.create_time }}</text>
                    </view>
                </view>

            </van-cell>
        </van-cell-group>

        <view class="no-orders" v-if="orderlist.length === 0">
            <text>暂无订单</text>
        </view>
    </view>
</template>
<script>
export default {
    name: 'OrderItem',
    props: ['orderlist'],
    methods: {
        handleDetail(order_id) {

            wx.navigateTo({
                url: `/pages/user/order/detail/main?id=${order_no}`
            })
        }
    },
}
</script>
<style></style>